home *** CD-ROM | disk | FTP | other *** search
/ Night Owl 6 / Night Owl's Shareware - PDSI-006 - Night Owl Corp (1990).iso / 001a / bgft211.zip / BGFTDXTL.SLT < prev    next >
Text File  |  1991-05-02  |  6KB  |  105 lines

  1. // BGFTDXTL.SLT: Telix script for BGFT Xmodem-CRC or 1K download.
  2. // Support Package for Registered Users of BGFT (TM).
  3. // Copyright 1990-1991 Dirac Systems.
  4. // Telix is a trademark of Exis Inc.
  5.  
  6. // MANUAL INSTALLATION:
  7. // The following outlines how to install the script for use as an
  8. //      external protocol in Telix:
  9. // Be sure that the resident part (BGFT360K.COM or BGFT720K.COM) of
  10. //      BGFT is loaded before the communications program. Add /B if
  11. //      you want Drive B:. The BGFT status window does not need to be
  12. //      active; it need only be resident.
  13. // The batch file BGFTINIT.BAT is used to initialize BGFT prior to
  14. //      running Telix. This file must be edited to contain information
  15. //      about your modem's port number and baud rate prior to use
  16. //      (default is 1200 baud, port 1). You must run the batch file
  17. //      BGFTINIT.BAT to make sure that BGFT is set up properly. THIS
  18. //      MUST BE DONE before using BGFT as an external protocol under
  19. //      Telix. This is true even though the baud and port are set here.
  20. // Put the right sized floppy (.720, 1.2, or 1.44 Megabyte DOS
  21. //      formatted, no errors for BGFT720K.COM ; the above or 360K DOS
  22. //      formatted, no errors for BGFT360K.COM) into the desired floppy
  23. //      drive. The floppy size must correspond to the drive type.
  24. // Compile the BGFTDXTL.SLT by using the Telix compiler, CS, viz.
  25. //      CS BGFTDXTL
  26. //      This will produce BGFTDXTL.SLC for use in Telix.
  27. // From terminal mode do 'Alt_O' for 'Configure Telix'.
  28. // Choose 'Protocol Options'.
  29. // 'Change which setting?': Choose one of the four external protocol
  30. //      options: A, B, C, or D.
  31. // Key: When in the download operation, pressing this key will choose
  32. //      the protocol. The key should not be used elsewhere, eg. X (Xmodem).
  33. //      Choose 'B', for example. It will be highlighted for the Telix
  34. //      download operation.
  35. // Protocol name: This is what will show up in the list of protocols when
  36. //      you choose the download operation. Call it, 'BGFTXmdm'.
  37. // Upload file name: For this example, leave it blank.
  38. // Download file name: Enter, BGFTDXTL. This will be the compiled script.
  39. // BAT or Script: Choose 'Script' since BGFTDXTL.SLT is a script.
  40. // DL name: Choose 'Y' for yes since you want Telix to pass the name of the
  41. //      file to the script. The script will get rid of Telix's download
  42. //      directory since BGFT only wants to put the filename on the floppy.
  43. // ESC out of the screen and save the set up to disk by hitting 'W'. This
  44. //      get you back into Telix terminal mode.
  45. // Download as you normally would (PgDn); tell the host to send via Xmodem-CRC.
  46. //      If being used for Xmodem-1K, BGFT will determine the correct packet.
  47. // Choose the BGFTXmdm protocol using arrows plus an ENTER or by the Key
  48. //      defined above.
  49. // The script will give some messages, start the background transfer, and
  50. //      exit Telix. You will be at the DOS prompt.
  51. // You should see the BGFT window indicate normal transmission.
  52. // Now you can do your work in foreground as the file is downloaded in
  53. //      background.
  54. // After completion you can use BGFT.EXE to move your files to some DOS
  55. //      directory. The files are ready to use.
  56. // Use BGFTOPT /3<Pathname> to dump downloaded files from the file buffer
  57. //      to a specified directory.
  58. //
  59.  
  60.  
  61. str command[80];                // Command string for BGFTOPT.
  62. str temp[80];                   // Temporary concatenation string.
  63. int downdirlen;                 // Telix download drive:directory str length.
  64. int extfilelen;                 // Telix external file maximum str length.
  65.  
  66. // The command we will issue to DOS is:
  67. //              BGFTOPT /q /a /r# /b# /~1 /dFn /s
  68. //    where:
  69. //      /q    - quiet mode (don't printout results)
  70. //      /a    - acknowledge any error that may be present
  71. //      /r#    - select port # (eg. /r1)
  72. //        /b#   - select baud # (eg. /b2400)
  73. //        /~1   - select protocol 1 (Xmodem-CRC and Xmodem-1K download)
  74. //        /dFn  - set download filename Fn (eg. test.tst)
  75. //      /s    - start the transfer
  76.  
  77. main()
  78. {
  79. command = "/q";                         // Start command line.
  80. strcat(command," /a");                  // Acknowledge any error.
  81. strcat(command," /r");
  82. itos(get_port(),temp);                  // Find out where we are connected.
  83. strcat(command,temp);                   // Reconnect existing comm port.
  84. strcat(command," /b");
  85. itos(get_baud(),temp);                  // Find out what is the baud rate.
  86. strcat(command,temp);                   // Set baud rate for resident.
  87. //
  88. //      BGFT requires a filename from Telix.
  89. //
  90. strcat(command," /d");                  // Set up download.
  91. downdirlen = strlen(_down_dir);         // Get unwanted Telix dnld directory.
  92. extfilelen = strmaxlen(_ext_filespec);  // Get maximum length of Telix file.
  93. substr(_ext_filespec,downdirlen,extfilelen,temp);    // Shave off dnld dir.
  94. strcat(command,temp);                   // Put BGFT filename in '/e' command.
  95. //
  96. //      Xmodem-CRC or Xmodem-1K Download
  97. //
  98. strcat(command," /~1");                 // This protocol is Xmodem-CRC.
  99. //                                      // Good for Xmodem-1K too.
  100. strcat(command," /s");                  // Start to send file.
  101. prints(command);                        // Tell user the command string.
  102. run("bgftopt.exe",command,2);
  103. exittelix(0,0);                         // Leave Telix; don't hangup line.
  104. }                                       // Now enjoy background Xmodem dnld.
  105.